<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../../css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>

<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.5.1.min.js"></script>
<script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>

<body>
<form class ="layui-form" action="/orders/add">
<div class="layui-form layuimini-form">

    <div class="layui-form-item">
        <label class="layui-form-label required">货物编号</label>
        <div class="layui-input-block">
            <input type="text" name="gid" lay-verify="required"  placeholder="请输入货物编号" value="" class="layui-input">

        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">用户编号</label>
        <div class="layui-input-block">
            <input type="text" name="uid" lay-verify="required"  placeholder="请输入用户编号" value="" class="layui-input">

        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">金额</label>
        <div class="layui-input-block">
            <input type="text" name="amount" lay-verify="required"  placeholder="请输入金额" value="" class="layui-input">

        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">订单类型</label>
        <div class="layui-input-block">
            <select name="otype" lay-filter="aihao">
                <option value=""></option>
                <option value="1"selected="">饮料</option>
                <option value="2" >日用品</option>
                <option value="3">玩具</option>
                <option value="4">文具</option>
                <option value="5">零食</option>
                <option value="6">蔬菜</option>
                <option value="7">水果</option>
                <option value="8">家具</option>
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">付费时间</label>
            <div class="layui-input-inline">
                <input type="text" name="ptime" id="ptime" placeholder="yyyy-MM-dd" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
    </div>



    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="formDemo">确认添加</button>
        </div>
    </div>
</div>
</form>
<script src="../../lib/layui-v2.6.3/layui.js" charset="utf-8">

</script>
<script>
    //Demo
    layui.use(['form'], function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.$;


        //监听提交
        form.on('submit(formDemo)', function (data) {
            // var index = layer.alert(JSON.stringify(data.field), {
            //title: '最终的提交信息';

            //添加成功弹出框
            layer.close('添加成功');
            return true;//true才会走action
            /* , function () {

                // 关闭弹出层
                layer.close(index);

                var iframeIndex = parent.layer.getFrameIndex(window.name);
                parent.layer.close(iframeIndex);*/

        });

        return false;
    });


</script>
<script>


    layui.use(['dropdown', 'util', 'layer', 'table'], function() {
        var dropdown = layui.dropdown
            , util = layui.util
            , layer = layui.layer
            , table = layui.table
            , $ = layui.jquery
            , laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#ptime'
        });
    });




</script>
</body>
</html>